<?php
 
// No direct access
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
jimport( 'joomla.application.component.model' );
 
/**
 * Hello Model
 *
 * @package    Joomla.Tutorials
 * @subpackage Components
 */
class AreasModelAreas extends JModel
{

	var $_data = null;

	/**
	 * Returns the query
	 * @return string The query to be used to retrieve the rows from the database
	 */
	function _buildQuery()
	{
	    $query = ' SELECT * '
		   . ' FROM #__area '
	    ;
	 
	    return $query;
	}
 

	/**
	 * Retrieves the area data
	 * @return array Array of objects containing the data from the database
	 */
	function getData()
	{
	    // Lets load the data if it doesn't already exist
	    if (empty( $this->_data ))
	    {
		$query = $this->_buildQuery();
		$query .= ' ORDER BY ordering ';
		$this->_data = $this->_getList( $query );
	    }
	 
	    return $this->_data;
	}
}

